library(variableStars) library(data.table) library(ggplot2) library(ggsci) library(microbenchmark) library(RColorBrewer)
dt.star <- data.frame(read.table("../data/freqs.dat", sep = " ")) colnames(dt.star) <- c("Id","frequency","Freq2","amplitude","Phase","Sig", "S/N","rms", "e_Freq1","e_Amp","e_Phase") head(dt.star) # Save Data to disk (to be replicated) write.table( dt.star[c("frequency", "amplitude")], file = "/tmp/data.csv", sep = "\t", quote = F, row.names = F, col.names = F )
Data gathering from the Antonio's PhD thesis.
plot_spectrum_ggplot(-5, 80, dt.star)
result <- process( dt.star$frequency, dt.star$amplitude, filter = "gaussian", gRegimen = 0, minDnu = 15, maxDnu = 95, dnuValue = -1, dnuGuessError = 10, dnuEstimation = TRUE, numFrequencies = 30, debug = TRUE )
# Plot frecuency and amplitude plot_apodization_ggplot( data.frame( "frequences" = result$apodization$frequences, "amplitude" = result$apodization$amp ) )
dt <- prepare_periodicities_dataset(result$fresAmps) plot_periodicities_ggplot(dt)
dt <- data.frame(result$diffHistogram$histogram) plot_histogram_ggplot(dt)
dt <- data.frame(result$crossCorrelation) plot_crosscorrelation_ggplot(dt)
dt <- data.frame( "x" = result$echelle$modDnuStacked, "y" = result$echelle$freMas, "h" = result$echelle$amplitudes ) plot_echelle_ggplot(dt)
dt <- data.frame( "x" = result$echelleRanges$`30`$modDnuStacked, "y" = result$echelleRanges$`30`$freMas, "h" = result$echelleRanges$`30`$amplitudes ) # Plot echelle plot_echelle_ggplot(dt)
# m <- # microbenchmark(result <- process( # dt.star$frequency, # dt.star$amplitude, # filter = "uniform", # gRegimen = 0, # minDnu = 15, # maxDnu = 95, # dnuValue = -1, # dnuGuessError = 10, # dnuEstimation = TRUE, # numFrequencies = 30, # debug = F # ) # ,times = 100) # autoplot(m, log = F) + # scale_x_discrete(labels = c("The complete process")) + # xlab("")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.